package com.aizhixin.test.my.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aizhixin.test.my.dto.GeRenPaiMinDTO;
import com.aizhixin.test.my.service.paiHangBangService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping(value = "/v1/open/gerenPaihangbang")
@Api(tags = "排行榜API")
@Slf4j
public class geRenPaiHangController {
	@Autowired
	private paiHangBangService textService;

 	@GetMapping(value="/{userId}",produces=MediaType.APPLICATION_JSON_VALUE)
 	@ApiOperation(httpMethod="GET",value="输入用户Id之后就可以获取用户在总表中的排名",
 	notes="输入Id之后输入用户Id之后就可以获取用户在总表中的排名<br><br><b>@author xixi</b>")
 	public GeRenPaiMinDTO getgerenPaiMin(
 			@ApiParam(value="输入用户Id",required=true)
 			@PathVariable Long userId) {
 		 log.debug("获取试题内容ID：{}", userId);
 		 GeRenPaiMinDTO Dto=textService.selectGeRenPaiHangBang(userId);
 	return Dto;
 	}
}
